package com.leetone.testng;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.PageFactory;
import org.testng.annotations.Test;

/**
 * @ProjectName: testng
 * @Package: com.leetone.testng
 * @ClassName: MyTestNg
 * @Description: 【百度搜索测试】
 * @Author: 谭磊
 * @Email: leetone123@163.com
 * @CreateDate: 2018/11/4 13:55
 * @UpdateUser: 更新者：
 * @UpdateDate: 2018/11/4 13:55
 * @UpdateRemark: 更新说明：接下来是写测试业务内容，加载页面的时候加入PageFactory
 * @Version: 1.0
 */
public class MyTestNg {
    private WebDriver driver = new ChromeDriver();

//    @Test
//    public void baiduSearch(){
//        BaiDuPage baiDuPage = PageFactory.initElements(driver,BaiDuPage.class);
//        driver.get("http://www.baidu.com");
//        driver.manage().window().maximize();//窗口最大化
//        baiDuPage.kwSendKeys("java");
//        baiDuPage.suClick();
//    }

    @Test
    public void okrLogin(){
        OkrPage okrPage = PageFactory.initElements(driver,OkrPage.class);
        driver.get("http://okr.betterokr.com");
        driver.manage().window().maximize();//窗口最大化
        okrPage.sendEmail("xxxxxxxxxxxxxxxxx");
        okrPage.sendPass("xxxxxxxxxxxxxxxx");
        okrPage.loginClick();
    }

}